package day05;


public class Demo02 {
    public static void main(String[] args) throws Exception {
        String str = "ABCα中文\uD83D\uDE02";
        //Unicode 转 GBK
        byte[] bytes = str.getBytes("GBK");
        for (byte b : bytes) {
            System.out.println(Integer.toBinaryString(b & 0xff));
        }
        //GBK 解码为 Unicode
        String s = new String(bytes, "GBK");
        System.out.println(s);
    }
}
